<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>通用字典新增</title>
<link href="../../static/plugin/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
<link href="../../static/plugin/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
<link href="../../static/css/esaas-easyui-add.css" rel="stylesheet" type="text/css"/>
<script src="../../static/plugin/easyui/jquery.min.js" type="text/javascript"></script>
<script src="../../static/plugin/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../static/plugin/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
<script src="../../ffres/dict/all.js" type="text/javascript"></script>
<a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<body class="easyui-layout">
	<form id="ff" method="post">
		<div class="esaas-info-title">修改密码</div>
		<table class="esaas-info-add-table">
			<tr>
				<td width="40%" align="right">原密码：</td>
				<td width="60%"><input class="easyui-textbox" type="password"
					name="password" data-options="required:true"
					style="width: 50%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="40%" align="right">新密码：</td>
				<td width="60%"><input class="easyui-textbox" type="password" id="newPassword"
					name="newPassword" data-options="required:true"
					style="width: 50%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="40%" align="right">确认密码：</td>
				<td width="60%"><input class="easyui-textbox" type="password" id="confirmPassword"
					name="confirmPassword" data-options="required:true"
					style="width: 50%; height: 25px;"></input></td>
			</tr>
		</table>
	</form>
	<div style="text-align: center; padding: 15px">
		<a href="javascript:void(0)" class="easyui-linkbutton"
			onclick="submitForm()">&nbsp;保&nbsp;存&nbsp;</a>
	</div>
	<script>
		$(function() {

		});

		function submitForm() {
			if (!$('#ff').form('validate'))
				return;
			
			if($("#newPassword").val() != $("#confirmPassword").val()) {
				alert("两次输入的密码不一致！");
				return;
			}
			
			var jsonData = $("#ff").serializeJson();
			$.restfulPostJson('../../api/account/modifyUserPwd', jsonData, function(data) {
				if(data.code == '0' && data.rows) {
					alert("密码修改成功！");
					$('#ff').form('reset');
				} else {
					if(data.message) {
						alert(data.message);
					} else {
						alert("密码修改失败！");
					}
				}
			});
		};
		
		function closeForm() {
			window.parent.JLEUtil.closewin();
		}
	</script>
</body>
</html>
